package com.tjetc;

public class _24DebugExercise {
    public static void main(String[] args) {
        // 创建对象的流程
        // 1. 加载类信息
        // 2. 初始化 （1）默认初始 （2）显示初始  （3）构造器初始化
        // 3. 将地址赋值给变量
        Person1 person1 = new Person1("zhangsan", 10);
        System.out.println(person1);
    }
}


class Person1{
    private String name;
    private int age;

    public Person1() {
    }

    public Person1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person1{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
